import { isMobile } from "@/util"
export const getWxUrl = () => {
  if (isMobile() && window.location.href.indexOf("/kfmap")>-1) {
    // 客服跳转小程序
    return 'https://j.youzan.com/SBp7kd'
  } else { 
    return 'https://shop19559733.m.youzan.com/v2/showcase/homepage?alias=kkL1cV61w1&dc_ps=2530329174946666501.200001&oid=51240241'
  }
}

export const skipShop = () => {
  isMobile() ? window.location = getWxUrl() : window.open(getWxUrl())
}

// 发票链接
export function goInvoice () {
  const url = process.env.VUE_APP_INVOICE_PATH + '/#/home'
  isMobile() ? window.location = url : window.open(url, 'xmbz_invoice')
}

// 查询订单
export function goOrder () {
  const url = process.env.VUE_APP_USER_PATH + '/#/login'
  isMobile() ? window.location = url : window.open(url, 'xmbz_user_web')
}
